﻿using Absky.Enum;

namespace Absky.Util
{
    /// <summary>
    /// 返回结果
    /// </summary>
    public class Result
    {
        public Result()
        {

        }
        public Result(ResultCodeEnum code, string message)
        {
            Code = code;
            Message = message;
        }
        /// <summary>
        /// 状态码
        /// </summary>
        public ResultCodeEnum Code { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 扩展字段
        /// </summary>
        public string Memo { get; set; }
    }
    public class Result<T> : Result
    {
        public Result()
        {

        }
        public Result(ResultCodeEnum code, string message)
        {
            Code = code;
            Message = message;
        }
        public Result(ResultCodeEnum code, T data)
        {
            Code = code;
            Data = data;
        }
        public Result(ResultCodeEnum code, string message, T data)
        {
            Code = code;
            Message = message;
            Data = data;
        }
        /// <summary>
        /// 数据
        /// </summary>
        public T Data { get; set; }
        public int Total { get; set; }
    }
}
